package com.woniuxy.rbac.service.impl;

import com.woniuxy.rbac.entity.User;
import com.woniuxy.rbac.mapper.UserMapper;
import com.woniuxy.rbac.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: 老谭（<a href="http://www.woniuxy.com">蜗牛学苑</a>）
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public void add(User user) {
        user.setStatus("y");
        userMapper.insert(user);
    }

    @Override
    public List<User> getAll() {
        return userMapper.list();
    }

    @Override
    public void delById(int id) {
        userMapper.del(id);
    }
}
